Skip to content

Conversation

@IIYAMA12
Copy link
Contributor

@IIYAMA12 IIYAMA12 commented Dec 24, 2025

Allows you to make some simple object movements in your map editor.

Changes:

  • More object properties
  • With the prop persistDefault="false", the data field will not persist when a default value is provided. Else this update would make all maps a bit bigger. I know persisting default values is generally better, but for this user case I find it unnecessary
  • Editor preview of how the objects are moving from start to end
  • Editor extension (file) modified to move the objects

Unknowns:

  • What does the edf.edf file do? I am not sure if I have to keep that file in sync with the editor_main.edf file.
mta-screen_2025-12-24_16-32-33 mta-screen_2025-12-24_17-29-39

Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a solid addition to the map editor, thank you!

I've tested the changes, they're working well. Although I do wonder whether it's worth adding an extra setting for "loop" to decide whether to repeat the movement at all? Currently an object will just keep looping.

Regarding your question on edf.edf, it's not necessary to update it here. The .edf file provided by the "edf" resource determines the default definitions for other resources (a fallback, when they don't provide their own .edf). Since your feature is entirely within the map editor, and bundles functionality into the "mapEditorScriptingExtension_s.lua" script (which is ran by gamemodes/resources such as race on map load), other resources don't need to know about these properties - they aren't "standard" properties.

Essentially, you only need to update the edf.edf for new "standard" entity properties, that all resources should be aware of. No need to update it here!

@IIYAMA12
Copy link
Contributor Author

Although I do wonder whether it's worth adding an extra setting for "loop" to decide whether to repeat the movement at all? Currently an object will just keep looping.

Same here, although in that case it might need a kind of trigger. Like adding 2 object props with a reference to a start and end marker.
Like:

<data name="moveBehaviour" type="selection:loop,marker" default="loop" description="Choose 'loop' if you want the object to move between the start and end point indefinitely. Or choose 'marker' and fill in the markerStart and markerEnd elements to make the object move based on marker enter." persistDefault="false" />
<data name="markerStart" type="element:marker" default="" description="When a player enters this marker, move the object to the start position" persistDefault="false" />
<data name="markerEnd" type="element:marker" default="" description="When a player enters this marker, move the object to the end position" persistDefault="false"  />

But the default behaviour should probably be 'loop' indefinitely. So it could be another feature later down the line without breaking the changes of the current pull request.

@Lpsd
Copy link
Member

Lpsd commented Jan 12, 2026

Yes! I thought that a trigger system would be awesome too, but didn't want to suggest too much extra work, even though it would be great.

I'm happy to defer that to another PR, as the current functionality is already cool.

However I do have a suggestion which is probably a quick win. Currently the looping behaviour is wrap-around (once reaches end it resets to the start). Can we add an option for "reciprocal" looping behaviour? So instead of going from A -> B and resetting back to A, it will go A -> B and then update the move target to A (moving smoothly back to the start position, instead of being reset there)?

@IIYAMA12
Copy link
Contributor Author

However I do have a suggestion which is probably a quick win. Currently the looping behaviour is wrap-around (once reaches end it resets to the start). Can we add an option for "reciprocal" looping behaviour? So instead of going from A -> B and resetting back to A, it will go A -> B and then update the move target to A (moving smoothly back to the start position, instead of being reset there)?

Afaik it is already doing that, but the (incorrect) animation is suggesting otherwise.
Let me fix that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants